package com.demo.common.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//拦截器配置类
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
  //默认拦截路径
  @Override
  public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(new JWTInterceptor())
      .addPathPatterns("/**")
      .excludePathPatterns("/files/**")//跳过files相关路径
      .excludePathPatterns("/user/login");//跳过登录路径
      
      
  }
}
